package com.atguigu.set;

import com.atguigu.map.AVLMap;

public class AVLSet<E extends Comparable<E>> implements Set<E> {

    private AVLMap<E,Object>avlMap;
    public static final Object VALUE=new Object();
    public AVLSet(){
        avlMap=new AVLMap<>();
    }
    @Override
    public void add(E e) {
        avlMap.add(e,VALUE);
    }

    @Override
    public void remove(E e) {
        avlMap.remove(e);
    }

    @Override
    public boolean contains(E e) {
        return avlMap.contains(e);
    }

    @Override
    public int getSize() {
        return avlMap.getSize();
    }

    @Override
    public boolean isEmpty() {
        return avlMap.isEmpty();
    }
}
